//
//  TYBaseRefreshViewController.h
//
//
//  Created by 黄卫 on 17/2/24.
//  Copyright © 2017年 huangwei. All rights reserved.
//

#import "TYBaseViewController.h"
#import "MJRefresh.h"

typedef NS_ENUM(NSInteger, TableState)
{
    TableStateRefreshing,   //刷新
    TableStateIdle,         //空闲
    TableStateLoading       //加载
};

@interface TYBaseRefreshViewController : TYBaseViewController
{
    @protected
    UITableView *_refreshTableview;
    NSMutableArray *_dataArray;
    NSDictionary *firstRsp;
}

@property (nonatomic, strong) NSString *pageNoKey;//请求页码的key, 默认为"pNo", 暴露出来有的接口为"pageNo"
@property (nonatomic, strong) NSString *pageSizeKey;//请求每页记录数的key, 默认为"pSize", 暴露出来有的接口为"pageSize"

@property (nonatomic, assign) TableState tableState;

/** 分页记录数*/
@property (nonatomic, assign) int pageSize;

@property (nonatomic, assign) NSInteger pageIndex;

@property (nonatomic, strong) NSMutableDictionary *firstPageParams;

@property(nonatomic,assign)BOOL ishidHeadRefresh;

/** urlKey:session/login、、   params:@{@"pNo":@1,@"pSize":@10} */
- (void)setUrlKey:(NSString *)urlKey firstPageParams:(NSDictionary *)params;

- (void)handleResponse:(id)returnValue;

/** 处理返回数据，子类实现 */
- (void)handleRspLst:(NSArray *)arr;

- (void)refreshStart;

- (NSDictionary *)requestDic;

@end
